package edu.mis.model;

import java.util.List;

import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Record;

import edu.mis.model.base.BaseCustomer;

/**
 * 鏈� demo 浠呰〃杈炬渶涓虹矖娴呯殑 jfinal 鐢ㄦ硶锛屾洿涓烘湁浠峰�肩殑瀹炵敤鐨勪紒涓氱骇鐢ㄦ硶
 * 璇﹁ JFinal 淇变箰閮�: http://jfinal.com/club
 * 
 * Blog model.
 * 鏁版嵁搴撳瓧娈靛悕寤鸿浣跨敤椹煎嘲鍛藉悕瑙勫垯锛屼究浜庝笌 java 浠ｇ爜淇濇寔涓�鑷达紝濡傚瓧娈靛悕锛� userId
 */
@SuppressWarnings("serial")
public class Customer extends BaseCustomer<Customer> {
	public static final Customer dao = new Customer().dao();
	
	
	/**
	 * 查询所有用户
	 * @return
	 */
	public List<Customer> findAll(){
		return dao.find("SELECT * FROM customer");
	}
	/**
	 * 根据用户名查找用户
	 * @param name
	 * @return
	 */
	public Customer findUserByName(String name){
		return findFirst("SELECT * FROM customer WHERE name = ? ",name);
	}
}


